import { createRouter, createWebHistory } from 'vue-router'

let router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: () => import('@/layout/index.vue'),
      children: [

        {
          path: '/home',
          component: () => import('@/views/home/index.vue'),
        },
        {
          path: '/task',
          component: () => import('@/views/task/index.vue'),
          children: [{
            path: 'business',
            component: () => import('@/views/task/components/business.vue'),
          },
          {
            path: 'operation',
            component: () => import('@/views/task/components/operation.vue'),
          }
          ]
        },
        {
          path: '/node',
          component: () => import('@/views/node/index.vue'),
          children: [{
            path: 'region',
            component: () => import('@/views/node/components/region.vue'),
          },
          {
            path: 'node',
            component: () => import('@/views/node/components/node.vue'),
          },
          {
            path: 'partner',
            component: () => import('@/views/node/components/partner.vue'),
          }
          ]
        },
        {
          path: '/node',
          component: () => import('@/views/node/index.vue'),
          children: [{
            path: 'region',
            component: () => import('@/views/node/components/region.vue'),
          },
          {
            path: 'node',
            component: () => import('@/views/node/components/node.vue'),
          },
          {
            path: 'partner',
            component: () => import('@/views/node/components/partner.vue'),
          }
          ]
        },
        {
          path: '/vm',
          component: () => import('@/views/vm/index.vue'),
          children: [{
            path: 'index',
            component: () => import('@/views/vm/components/index.vue'),
          },
          {
            path: 'status',
            component: () => import('@/views/vm/components/status.vue'),
          },
          {
            path: 'type',
            component: () => import('@/views/vm/components/type.vue'),
          }
          ]
        },
        {
          path: '/user',
          component: () => import('@/views/user/index.vue'),
          children: [{
            path: 'index',
            component: () => import('@/views/user/components/index.vue'),
          },
          {
            path: 'user-task-stats',
            component: () => import('@/views/user/components/user-task-stats.vue'),
          },
          {
            path: 'user-work',
            component: () => import('@/views/user/components/user-work.vue'),
          }
          ]
        },
        {
          path: '/sku',
          component: () => import('@/views/sku/index.vue'),
          children: [{
            path: 'sku-class',
            component: () => import('@/views/sku/components/sku-class.vue'),
          },
          {
            path: 'sku',
            component: () => import('@/views/sku/components/sku.vue'),
          }

          ]
        },
        {
          path: '/policy',
          component: () => import('@/views/policy/index.vue'),
        },
        {
          path: '/order',
          component: () => import('@/views/order/index.vue'),
        },
        {
          path: '/report',
          component: () => import('@/views/report/index.vue'),
        }
      ]
    },
    {
      path: '/login',
      component: () => import('@/views/login/index.vue'),
    },

  ]
})
export default router
